package com.mmlc.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ScrollView;

import com.handmark.pulltorefresh.library.PullToRefreshScrollView;
import com.mmlc.meimei.lichengkongjian.R;

/**
 * Created by Administrator on 2016/7/22.
 */
public class ObserveScrollView extends PullToRefreshScrollView {

    public ObserveScrollView(Context context) {
        super(context);
    }

    public ObserveScrollView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public ObserveScrollView(Context context, Mode mode) {
        super(context, mode);
    }

    public ObserveScrollView(Context context, Mode mode, AnimationStyle style) {
        super(context, mode, style);
    }

    @Override
    protected ScrollView createRefreshableView(Context context, AttributeSet attrs) {
        MyScrollView scrollView = new MyScrollView(context, attrs);
        scrollView.setId(R.id.scrollview);
        return scrollView;
    }

    MyScrollView.OnScrollListener onScrollListener;

    public void setOnScrollListener(MyScrollView.OnScrollListener onScrollListener) {
        this.onScrollListener = onScrollListener;
        MyScrollView scrollView = (MyScrollView) getRefreshableView();
        scrollView.setOnScrollListener(this.onScrollListener);
    }

}

